package com.qf.collection.pk;

import java.util.Collection;

public class SpeedPK {


    public static void testAddSpeed(String[] source, Collection<String> c){
        long start = System.currentTimeMillis();
        for (String s : source) {
            c.add(s);
        }
        long end = System.currentTimeMillis();
        System.out.println(String.format("数据量=%d,参数选手为：%s,time=%d",source.length, c.getClass().getName(), (end - start)));
    }


    public static void testFindSpeed(String[] source, Collection<String> c){
        long start = System.currentTimeMillis();
        for (String s : source) {
            c.contains(s);
        }
        long end = System.currentTimeMillis();
        System.out.println(String.format("参数选手为：%s,time=%d", c.getClass().getName(), (end - start)));
    }

}
